package com.lib76.buildCode.model;

import java.util.LinkedHashMap;
import java.util.List;

import org.apache.commons.lang.StringUtils;

/**
 * 菜单配置信息
 * @author 张浩
 * @version 0.0.4
 */
public class Menu {

	private String parent = "root";	//父菜单路径字符串,如：它的子菜单的parent属性为：root.code
	private String code;
	private String name;
	private String url;
	private LinkedHashMap<String,Menu> children;
	
	public String getParent() {
		return parent;
	}
	public void setParent(String parent) {
		this.parent = parent;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public LinkedHashMap<String, Menu> getChildren() {
		return children;
	}
	public void setChildren(LinkedHashMap<String, Menu> children) {
		this.children = children;
	}
	public String getId(){
		if(StringUtils.isNotBlank(code)){
			return parent+"."+code;
		}else{
			return null;
		}
	}
}
